#!/usr/bin/env python3
"""Working with directories.
"""

#end_pymotw_header
import os

dir_name = 'os_directories_example'

print('Creating', dir_name)

#当前目录下创建一个文件夹
# os.makedirs(dir_name)
os.makedirs(dir_name, exist_ok=True)

file_name = os.path.join(dir_name, 'example.txt')
print('Creating', file_name)
with open(file_name, 'wt') as f:
    f.write('example file')

print('Cleaning up')
#这也是删除，删除文件
os.unlink(file_name)
os.rmdir(dir_name)
